﻿using FluentValidation.Validators;

namespace RockBus.ConfigurationService.Validation
{
    public class NullOrNotEmptyValidator : NotEmptyValidator
    {
        public NullOrNotEmptyValidator(object defaultValueForType)
            : base(defaultValueForType)
        {
        }

        protected override bool IsValid(PropertyValidatorContext context)
        {
            if (context.PropertyValue == null)
            {
                return true;
            }

            return base.IsValid(context);
        }
    }
}